<template>
  <div id="article">
    <van-nav-bar
      title=""
      left-text="返回"
      right-text=""
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <div class="article-main" id="content" v-html="content">
      
    </div>
    <div id="article-related">
      <h3>相关推荐</h3>
      <ul id="related-boxs">
        <li id="related-box">
          <div id="h4p-box">
            <h4>懒洋洋</h4>
            <h6>#懒羊羊的懒洋洋</h6>
          </div>
          <img src="../../assets/image/x09.jpeg" alt="" />
        </li>
        <li id="related-box">
          <div id="h4p-box">
            <h4>懒洋洋</h4>
            <h6>#懒羊羊的懒洋洋</h6>
          </div>
          <img src="../../assets/image/x09.jpeg" alt="" />
        </li>
      </ul>
    </div>

    <div id="share">
      <div id="share-box">
        <van-icon name="share" class="share-ico" color="#79ad70" />
        <div is-link @click="showPopup">分享</div>
      </div>
      <div id="share-box">
        <van-icon name="star" class="share-ico" color="#e2b61a" />
        <p>收藏</p>
      </div>
      <div id="share-box">
        <van-icon name="map-marked" class="share-ico" color="red" />
        <p>探索</p>
      </div>
    </div>
    <van-popup
      v-model="show"
      closeable
      close-icon="close"
      position="bottom"
      :style="{ height: '16%' }"
    >
      <div id="icon-chatbox">
        <div class="icon-wechat">
          <van-icon class="icon-chat" color="#26da6f" name="wechat" />
          <p>微信</p>
        </div>
        <div class="icon-wechat">
          <van-icon class="icon-chat" color="#5762d5" name="alipay" />
          <p>支付宝</p>
        </div>
        <div class="icon-wechat">
          <van-icon class="icon-chat" color="#ff7043" name="chat" />
          <p>其他社交</p>
        </div>
      </div>
    </van-popup>
  </div>
</template>

<script>
import { Toast } from "vant";
import axios from 'axios'

export default {
  data() {
    return {
      show: false,
      content:''
    };
  },
  methods: {
    onClickLeft() {
      this.$store.commit("tabShow");
      this.$router.go(-1);
    },
    onClickRight() {
      Toast("");
    },
    showPopup() {
      this.show = true;
    },
  },
  created() {
    this.$store.commit("tabHide");
  },
  mounted(){
    console.log()
    axios.get('http://localhost:3002/api/l1/Text/'+this.$route.query.id).then(r=>{
      this.content=r.data.data.content.replaceAll('$#contentImg#$','http://localhost:3002')
    })
  },
  
};
</script>

<style lang="scss" scoped>
#article {
  font-family: DS-Digital-Bold, serif;
  background: #f2f4f8;
  .article-main {
    min-height: 690px;
    background: #fff;
    overflow: hidden;
    h3 {
      text-align: center;
      margin-top: 30px;
      line-height: 30px;
      font-weight: 600;
    }
    .articlemain {
      margin: 0 22px;
      p {
        font-size: 14px;
        margin-top: 20px;
      }
      b {
        font-size: 15px;
      }
      img {
        max-width: 100%;
      }
      h4 {
        color: #999;
        margin-bottom: 10px;
      }
    }
  }
  #article-related {
    background: #fff;
    margin-top: 10px;
    overflow: hidden;
    h3 {
      margin: 20px 0 0 10px;
      font-weight: 400;
    }
    #related-boxs {
      margin: 0 10px;
      margin-top: 10px;
      padding-bottom: 50px;
      #related-box {
        margin-top: 10px;
        border-bottom: #cecece 1px solid;
        width: 374px;
        display: flex;
        justify-content: space-between;
        background: #fff;
        padding-bottom: 10px;
        img {
          width: 95px;
          height: 95px;
          margin-right: 15px;
          margin-top: 3px;
        }
        #h4p-box {
          display: flex;
          flex-direction: column;
          h4 {
            margin-top: 10px;
          }
          h6 {
            font-weight: normal;
            color: #999;
            margin-top: 55px;
          }
        }
      }
    }
  }
  #share {
    height: 30px;
    width: 375px;
    position: fixed;
    bottom: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    // opacity: 0.8;
    #share-box {
      display: flex;
      font-size: 20px;
      margin-top: 5px;
    }
  }
  #icon-chatbox {
    display: flex;
    justify-content: space-around;
    .icon-chat {
      margin-top: 15px;
      font-size: 60px;
    }
  }
}
</style>
